//
//  HMUserAccount.m
//  SinaWeiBo
//
//  Created by WGP on 16/4/12.
//  Copyright © 2016年 WGP. All rights reserved.
//

#import "HMUserAccount.h"

@implementation HMUserAccount

+(instancetype)userAccountWithDict:(NSDictionary *)dict
{
    id obj= [[self alloc] init];
    [obj setValuesForKeysWithDictionary:dict];
    return obj;
}


-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
//    HMLog(@"key: %@",key);
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_access_token forKey:@"access_token"];
    [aCoder encodeObject:_uid forKey:@"uid"];
    [aCoder encodeDouble:_expires_in forKey:@"expires_in"];
    [aCoder encodeObject:_expiresDate forKey:@"expiresDate"];
    [aCoder encodeObject:_screen_name forKey:@"screen_name"];
    [aCoder encodeObject:_avatar_large forKey:@"avatar_large"];
    
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    if(self = [super init])
    {
        _access_token = [aDecoder decodeObjectForKey:@"access_token"];
        _uid = [aDecoder decodeObjectForKey:@"uid"];
        _expiresDate = [aDecoder decodeObjectForKey:@"expiresDate"];
        _expires_in = [aDecoder decodeDoubleForKey:@"expires_in"];
        _screen_name = [aDecoder decodeObjectForKey:@"screen_name"];
        _avatar_large = [aDecoder decodeObjectForKey:@"avatar_large"];
    }
    return self;
}

@end
